package com.kashow.bean.circle.collect;

import android.text.TextUtils;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.kashow.bean.BaseBean;
import com.kashow.bean.circle.CircleItemBean;

import java.util.List;

/**
 * Created by cg on 16/12/26.
 */

public class Collection extends BaseBean implements MultiItemEntity {


    private static final String TYPE_VIDEO = "video";
    /**
     * _id : 6
     * title : 放大招
     * type : 1
     * audio : 1
     * cover : http://oh2ucnq1s.bkt.clouddn.com/99e0ba9b84dad9b2a678241419449358
     * user : {"_id":4,"unionid":"ojmTMwMprH1CkmyAHphBoOx99qpA","createdAt":"2017-01-03T05:49:57.455Z","isSub":false,"sex":1,"balance":0,"score":0,"level":1,"isTeacher":true,"__v":0,"headimgurl":"http://wx.qlogo.cn/mmopen/DzA0ABBGfr1PoUAGLJwAyx868AnTQ0GWpNWN0TPc6iajeFqVSHF5TUP9QlQtMHxBCvE0edFgdKWBq4XJHUcy7WPhibte3py56H/0","nickname":"周祚栋","wxUserInfo":{"openid":"o2Bvkvtse6Z2gjn5Db0celLfV0hg","nickname":"祚栋 �","sex":1,"language":"zh_CN","city":"","province":"","country":"","headimgurl":"http://wx.qlogo.cn/mmopen/nF4eIibsVk3wkZnDZ34B8Ric7myJxLxicRcb0VmtMejH4ra2E8FXRY8cSaJDZibhdBV2PWbeSr4Fgq0V8dKvHUCpUv7QmWLZdsm6/0","unionid":"ojmTMwMprH1CkmyAHphBoOx99qpA","tagid_list":[]},"phone":"18826515515","authInfo":{"intro":"暂无","realName":"周祚栋","cardNumber":"360731199101054872","cardPic1":"http://oss.kashowvr.com/wx/upload/media/z5Q5ZCR_xGpIedrR6DFrOLsN7AMcYOfVxh78oEdTWaPeG7SHbfHhxBv3fwFnXV60.","cardPic2":"http://oss.kashowvr.com/wx/upload/media/YgVR0DmsSD903YNpW1MUebf4XlYVu6Qoi6ojyb2GRziOLCKY355E9HDRQ9WBV0YN.","status":1,"updatedAt":"2017-01-03T07:29:49.255Z","createdAt":"2017-01-03T07:29:49.255Z"},"updatedAt":"2017-01-03T07:29:49.256Z","password":"e61044ecc0e835b0f39e225a34f8b794","appopenid":"o2Bvkvtse6Z2gjn5Db0celLfV0hg","birthday":"2017-01-04T00:00:00.000Z","supplement":{"centerBgUrl":"http://oss.kashowvr.com/images/syy_center_bg.png"}}
     * deleted : 0
     * watch : 40
     * updatedAt : 2017-01-04T05:47:54.555Z
     * content : {"type":"video","item":[{"video":"http://oh2ucnq1s.bkt.clouddn.com/920ee5fad320cd8170c517e02512b1eb","imageUrl":"http://oh2ucnq1s.bkt.clouddn.com/1fbe9276a19ce1436ffd6cc205380b4e"}]}
     * createdAt : 2017-01-04 13:47:54
     * __v : 0
     * star : 0
     * hasStared : 0
     */

    private int _id;
    private String title;
    private int type;
    private int audio;
    private String cover;
    private UserBean user;
    private int deleted;
    private int watch;
    private String updatedAt;
    private ContentBean content;
    private String createdAt;
    private int star;
    private int hasStared;

    @Override
    public int getItemType() {
        if (TYPE_VIDEO.equals(content.getType())){
            return 2;
        } else {
            if (content != null && content.getItem() != null && content.getItem().size() >=3) {
                return 3;
            }
        }
        return 1;
    }

    public int get_id() {
        return _id;
    }

    public void set_id(int _id) {
        this._id = _id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getAudio() {
        return audio;
    }

    public void setAudio(int audio) {
        this.audio = audio;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    public int getWatch() {
        return watch;
    }

    public void setWatch(int watch) {
        this.watch = watch;
    }

    public String getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(String updatedAt) {
        this.updatedAt = updatedAt;
    }

    public ContentBean getContent() {
        return content;
    }

    public void setContent(ContentBean content) {
        this.content = content;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public int getStar() {
        return star;
    }

    public void setStar(int star) {
        this.star = star;
    }

    public int getHasStared() {
        return hasStared;
    }

    public void setHasStared(int hasStared) {
        this.hasStared = hasStared;
    }


    public static class UserBean {
        /**
         * _id : 4
         * unionid : ojmTMwMprH1CkmyAHphBoOx99qpA
         * createdAt : 2017-01-03T05:49:57.455Z
         * isSub : false
         * sex : 1
         * balance : 0
         * score : 0
         * level : 1
         * isTeacher : true
         * __v : 0
         * headimgurl : http://wx.qlogo.cn/mmopen/DzA0ABBGfr1PoUAGLJwAyx868AnTQ0GWpNWN0TPc6iajeFqVSHF5TUP9QlQtMHxBCvE0edFgdKWBq4XJHUcy7WPhibte3py56H/0
         * nickname : 周祚栋
         * wxUserInfo : {"openid":"o2Bvkvtse6Z2gjn5Db0celLfV0hg","nickname":"祚栋 �","sex":1,"language":"zh_CN","city":"","province":"","country":"","headimgurl":"http://wx.qlogo.cn/mmopen/nF4eIibsVk3wkZnDZ34B8Ric7myJxLxicRcb0VmtMejH4ra2E8FXRY8cSaJDZibhdBV2PWbeSr4Fgq0V8dKvHUCpUv7QmWLZdsm6/0","unionid":"ojmTMwMprH1CkmyAHphBoOx99qpA","tagid_list":[]}
         * phone : 18826515515
         * authInfo : {"intro":"暂无","realName":"周祚栋","cardNumber":"360731199101054872","cardPic1":"http://oss.kashowvr.com/wx/upload/media/z5Q5ZCR_xGpIedrR6DFrOLsN7AMcYOfVxh78oEdTWaPeG7SHbfHhxBv3fwFnXV60.","cardPic2":"http://oss.kashowvr.com/wx/upload/media/YgVR0DmsSD903YNpW1MUebf4XlYVu6Qoi6ojyb2GRziOLCKY355E9HDRQ9WBV0YN.","status":1,"updatedAt":"2017-01-03T07:29:49.255Z","createdAt":"2017-01-03T07:29:49.255Z"}
         * updatedAt : 2017-01-03T07:29:49.256Z
         * password : e61044ecc0e835b0f39e225a34f8b794
         * appopenid : o2Bvkvtse6Z2gjn5Db0celLfV0hg
         * birthday : 2017-01-04T00:00:00.000Z
         * supplement : {"centerBgUrl":"http://oss.kashowvr.com/images/syy_center_bg.png"}
         */

        private int _id;
        private String unionid;
        private String createdAt;
        private boolean isSub;
        private int sex;
        private int balance;
        private float score;
        private int level;
        private boolean isTeacher;
        private String headimgurl;
        private String nickname;
        private WxUserInfoBean wxUserInfo;
        private String phone;
        private AuthInfoBean authInfo;
        private String updatedAt;
        private String password;
        private String appopenid;
        private String birthday;
        private SupplementBean supplement;

        public int get_id() {
            return _id;
        }

        public void set_id(int _id) {
            this._id = _id;
        }

        public String getUnionid() {
            return unionid;
        }

        public void setUnionid(String unionid) {
            this.unionid = unionid;
        }

        public String getCreatedAt() {
            return createdAt;
        }

        public void setCreatedAt(String createdAt) {
            this.createdAt = createdAt;
        }

        public boolean isIsSub() {
            return isSub;
        }

        public void setIsSub(boolean isSub) {
            this.isSub = isSub;
        }

        public int getSex() {
            return sex;
        }

        public void setSex(int sex) {
            this.sex = sex;
        }

        public int getBalance() {
            return balance;
        }

        public void setBalance(int balance) {
            this.balance = balance;
        }

        public float getScore() {
            return score;
        }

        public void setScore(float score) {
            this.score = score;
        }

        public int getLevel() {
            return level;
        }

        public void setLevel(int level) {
            this.level = level;
        }

        public boolean isIsTeacher() {
            return isTeacher;
        }

        public void setIsTeacher(boolean isTeacher) {
            this.isTeacher = isTeacher;
        }

        public String getNickname() {
            if (TextUtils.isEmpty(nickname) && wxUserInfo != null) {
                nickname = wxUserInfo.getNickname();
            }
            return nickname;
        }

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public String getHeadimgurl() {
            if (TextUtils.isEmpty(headimgurl) && wxUserInfo != null) {
                headimgurl = wxUserInfo.getHeadimgurl();
            }
            return headimgurl;
        }

        public void setHeadimgurl(String headimgurl) {
            this.headimgurl = headimgurl;
        }

        public WxUserInfoBean getWxUserInfo() {
            return wxUserInfo;
        }

        public void setWxUserInfo(WxUserInfoBean wxUserInfo) {
            this.wxUserInfo = wxUserInfo;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public AuthInfoBean getAuthInfo() {
            return authInfo;
        }

        public void setAuthInfo(AuthInfoBean authInfo) {
            this.authInfo = authInfo;
        }

        public String getUpdatedAt() {
            return updatedAt;
        }

        public void setUpdatedAt(String updatedAt) {
            this.updatedAt = updatedAt;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getAppopenid() {
            return appopenid;
        }

        public void setAppopenid(String appopenid) {
            this.appopenid = appopenid;
        }

        public String getBirthday() {
            return birthday;
        }

        public void setBirthday(String birthday) {
            this.birthday = birthday;
        }

        public SupplementBean getSupplement() {
            return supplement;
        }

        public void setSupplement(SupplementBean supplement) {
            this.supplement = supplement;
        }

        public static class WxUserInfoBean {
            /**
             * openid : o2Bvkvtse6Z2gjn5Db0celLfV0hg
             * nickname : 祚栋 �
             * sex : 1
             * language : zh_CN
             * city :
             * province :
             * country :
             * headimgurl : http://wx.qlogo.cn/mmopen/nF4eIibsVk3wkZnDZ34B8Ric7myJxLxicRcb0VmtMejH4ra2E8FXRY8cSaJDZibhdBV2PWbeSr4Fgq0V8dKvHUCpUv7QmWLZdsm6/0
             * unionid : ojmTMwMprH1CkmyAHphBoOx99qpA
             * tagid_list : []
             */

            private String openid;
            private String nickname;
            private int sex;
            private String language;
            private String city;
            private String province;
            private String country;
            private String headimgurl;
            private String unionid;
            private List<String> tagid_list;

            public String getOpenid() {
                return openid;
            }

            public void setOpenid(String openid) {
                this.openid = openid;
            }

            public String getNickname() {
                return nickname;
            }

            public void setNickname(String nickname) {
                this.nickname = nickname;
            }

            public int getSex() {
                return sex;
            }

            public void setSex(int sex) {
                this.sex = sex;
            }

            public String getLanguage() {
                return language;
            }

            public void setLanguage(String language) {
                this.language = language;
            }

            public String getCity() {
                return city;
            }

            public void setCity(String city) {
                this.city = city;
            }

            public String getProvince() {
                return province;
            }

            public void setProvince(String province) {
                this.province = province;
            }

            public String getCountry() {
                return country;
            }

            public void setCountry(String country) {
                this.country = country;
            }

            public String getHeadimgurl() {
                return headimgurl;
            }

            public void setHeadimgurl(String headimgurl) {
                this.headimgurl = headimgurl;
            }

            public String getUnionid() {
                return unionid;
            }

            public void setUnionid(String unionid) {
                this.unionid = unionid;
            }

            public List<String> getTagid_list() {
                return tagid_list;
            }

            public void setTagid_list(List<String> tagid_list) {
                this.tagid_list = tagid_list;
            }
        }

        public static class AuthInfoBean {
            /**
             * intro : 暂无
             * realName : 周祚栋
             * cardNumber : 360731199101054872
             * cardPic1 : http://oss.kashowvr.com/wx/upload/media/z5Q5ZCR_xGpIedrR6DFrOLsN7AMcYOfVxh78oEdTWaPeG7SHbfHhxBv3fwFnXV60.
             * cardPic2 : http://oss.kashowvr.com/wx/upload/media/YgVR0DmsSD903YNpW1MUebf4XlYVu6Qoi6ojyb2GRziOLCKY355E9HDRQ9WBV0YN.
             * status : 1
             * updatedAt : 2017-01-03T07:29:49.255Z
             * createdAt : 2017-01-03T07:29:49.255Z
             */

            private String intro;
            private String realName;
            private String cardNumber;
            private String cardPic1;
            private String cardPic2;
            private int status;
            private String updatedAt;
            private String createdAt;

            public String getIntro() {
                return intro;
            }

            public void setIntro(String intro) {
                this.intro = intro;
            }

            public String getRealName() {
                return realName;
            }

            public void setRealName(String realName) {
                this.realName = realName;
            }

            public String getCardNumber() {
                return cardNumber;
            }

            public void setCardNumber(String cardNumber) {
                this.cardNumber = cardNumber;
            }

            public String getCardPic1() {
                return cardPic1;
            }

            public void setCardPic1(String cardPic1) {
                this.cardPic1 = cardPic1;
            }

            public String getCardPic2() {
                return cardPic2;
            }

            public void setCardPic2(String cardPic2) {
                this.cardPic2 = cardPic2;
            }

            public int getStatus() {
                return status;
            }

            public void setStatus(int status) {
                this.status = status;
            }

            public String getUpdatedAt() {
                return updatedAt;
            }

            public void setUpdatedAt(String updatedAt) {
                this.updatedAt = updatedAt;
            }

            public String getCreatedAt() {
                return createdAt;
            }

            public void setCreatedAt(String createdAt) {
                this.createdAt = createdAt;
            }
        }

        public static class SupplementBean {
            /**
             * centerBgUrl : http://oss.kashowvr.com/images/syy_center_bg.png
             */

            private String centerBgUrl;

            public String getCenterBgUrl() {
                return centerBgUrl;
            }

            public void setCenterBgUrl(String centerBgUrl) {
                this.centerBgUrl = centerBgUrl;
            }
        }
    }

    public static class ContentBean {
        /**
         * type : video
         * item : [{"video":"http://oh2ucnq1s.bkt.clouddn.com/920ee5fad320cd8170c517e02512b1eb","imageUrl":"http://oh2ucnq1s.bkt.clouddn.com/1fbe9276a19ce1436ffd6cc205380b4e"}]
         */

        private String type;
        private List<CircleItemBean> item;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public List<CircleItemBean> getItem() {
            return item;
        }

        public void setItem(List<CircleItemBean> item) {
            this.item = item;
        }
    }
}


